package com.example.yls.demoa;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class MyBroadcas extends BroadcastReceiver{
    @Override
    public void onReceive(Context context, Intent intent) {
      String action=intent.getAction();

      if (action.equals("weather_info")) {
          int wendu = intent.getIntExtra("wendu",0);
          String weather = intent.getStringExtra("weather");
          Log.e("MyBroadcas", "weather  " + weather + "  wendu  " + wendu);
      }else if(action.equals("traffic_info")){
          int time = intent.getIntExtra("time", 0);
          String traffic = intent.getStringExtra("traffic");
          Log.e("MyBroadcas", "traffic  " + traffic+ "  time  " + time);
      }

    }
}
